package com.etong.frame.directive.impl.database;

import java.util.Map;

import com.etong.frame.directive.util.CommonStatus;

public class DatabaseDefault extends DatabaseDirective {

	String defaultBuilder = "";

	public DatabaseDefault(Statement statement) {
		super(statement);
		setNeedFields(false);
	}

	@Override
	public boolean buildConst(Statement op) {

		defaultBuilder = getStatement().getCall_expr();
		// 创建Select语句变量
		addPlaceholders(createPlaceholders(defaultBuilder, true));

		logger.info("Build common:" + getStatement().getName() + "->"
				+ defaultBuilder);
		return true;
	}

	@Override
	protected CommonStatus buildVariable(Map<String, Object> vars) {
		CommonStatus status = new CommonStatus();
		status.setObject(defaultBuilder);
		return status;
	}

	public String getStatementConfig() {
		return defaultBuilder;
	}

}
